from django.db import models


# Create your models here.


class Activity(models.Model):
    """活动数据表"""
    name = models.CharField(max_length=32, verbose_name="活动名称")
    city = models.CharField(max_length=32, verbose_name="举办城市")
    cover = models.CharField(max_length=128, verbose_name="封面")
    start_time = models.DateTimeField(verbose_name="开始时间")
    end_time = models.DateTimeField(verbose_name="结束时间")
    dead_line = models.DateTimeField(verbose_name="报名截止日期")
    address = models.CharField(max_length=64, verbose_name="主办方地址")
    sponsor = models.CharField(max_length=16, verbose_name="主办方")
    website = models.CharField(max_length=128, verbose_name="活动官网")
    abstract = models.TextField(verbose_name="会议简介")
    detail = models.TextField(verbose_name="议题简介")
    status = models.IntegerField(verbose_name="报名状态", default=1)
    click_count = models.IntegerField(verbose_name="点击量", default=0)

    class Meta:
        """指定数据表名"""

        db_table = 'tb_activity'
        verbose_name = '活动'
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.id) + self.name